<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Area extends Model
{
    use HasFactory;

    protected $table = 'rooms_area';

    protected $fillable = ['name', 'r_id']; // 允许批量赋值的字段列表

    // 关联room表
    public function room()
    {
        return $this->belongsTo(Room::class, 'r_id');
    }


}
